/*
 *  engine.h
 *  
 *  Created by James Dykstra
 *	Team 5
 *
 *  Copyright 2010 Michigan Technological University. All rights reserved.
 */

#ifndef ENGINE_H
#define ENGINE_H

#define FPS 25

#include "renderer.h"
#include "Map.h"
#include "timer.h"
#include "logic.h"
#include "tinyxml/tinyxml.h"
#include "playerControlledShip.h"
#include "network.h"
#include "SDL/SDL_thread.h"

class GameEngine
{
	public:
		GameEngine(char *ip);
		~GameEngine();
		
		void 		run();
		void     	settingWrite( string settingname, string settingvalue );
		const char 	*settingRead( string settingname );
		
	private:
		Renderer 	*renderer;
		Map      	*map;
		Network		*net;
		SDL_Thread	*sthread;
		Logic		*logic;
		Fighter 	*player;
		Timer    	*fps;
		Timer	 	*delta;
		bool     	running;
		SDL_Event 	keyevent;
		Opponent	*opponents[MAX_CLIENTS];
		Sound   	*sound;		
		void 		draw();
		void 		update();
		void		netUpdate();
		void 		capFrameRate();
		bool		handleInput();
		SDL_Rect	lastPos;
		double		lastAngle;
};

#endif
